<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index07-Symbol</title>
</head>
<body>
    <script type="text/javascript">
        // // 创建Symbol对象
        // let sb = Symbol();
        // console.log(sb);
        // console.log(typeof(sb));
        // let sb2 = Symbol();
        // console.log(sb == sb2); // false
        // 关于在对象中使用Symbol
        let obj = {
          name: '张三',
          age: 20
        };
        // obj['address'] = "南京路";
        // obj['address'] = '湖南路';
        let symbol1 = Symbol('address');
        obj[symbol1] = "南京路";
        let symbol2 = Symbol('address');
        obj[symbol2] = "湖南路";
        console.log(obj);
        // for (let attr in obj) {
        //   console.log(attr);
        // }
        // console.log(obj[symbol1]);
        // console.log(obj[symbol2]);
        // console.log(Symbol('boo') === Symbol('boo'));
        // console.log(Symbol.for("far") === Symbol.for("far"));
    </script>
</body>
</html>